home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / tools / manlist < prev    next >
Text File  |  1992-08-29  |  1KB  |  35 lines

  1. #! /bin/sh
  2.  
  3. # usage: manlist < DISTLIST
  4.  
  5. # Given a list DISTLIST of source files to distribute with a package,
  6. # this script generates (on standard output) a list of installed man
  7. # pages which should accompany that package.  The intended use is that
  8. # you run the "distlist" script to generate a preliminary distribution
  9. # list, which you then pipe to manlist.  The final distribution list is
  10. # the concatentation of the preliminary list with the output of manlist,
  11. # e.g. "manlist < DISTLIST >> DISTLIST".
  12.  
  13. # NOTE: This script assumes that all man page files end in .1, .3, or
  14. # .5.  It also assumes that any file in the source tree ending with
  15. # one of these suffixes is a man page.
  16.  
  17. # pick out pathnames from the src tree that end in .1, .3, or .5:
  18. for file in `grep '\./src.*\.[135]$'` ; do
  19.   basename $file ;
  20. done |
  21.  
  22. # now replace the final ".n" with " n"; i.e. replace the last period
  23. # with a space.  We do this just in case some names have more than
  24. # one period in them.
  25. sed -e 's:\.\([135]\)$: \1:' |
  26.  
  27. # now print the pathnames of the installed copies of the man pages;
  28. # awk can now assume that $1 is the basename, $2 the suffix (= the man
  29. # section number).
  30. awk '{ printf "./man/man%s/%s.%s\n", $2,$1,$2 ;
  31.       printf "./man/cat%s/%s.%s\n", $2,$1,$2 ; }' |
  32.  
  33. # and finally, just for prettiness, sort:
  34. sort
  35.